package stu.rutlabai;

import java.util.Random;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

public class Main_RutLaBai extends Activity {
	ImageView imvHinhAnh;
	TextView tvTenConVat;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout__rutlabai);
		imvHinhAnh=(ImageView)findViewById(R.id.imageView1);
		tvTenConVat=(TextView)findViewById(R.id.tvTenConVat);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.layout__rutlabai, menu);
		return true;
	}
			String []ten_hinh_anh=
			{
			"Ách Chuồng","Ách Rô","Ách Cơ","Ách Bích",
			"Hai Chuồng","Hai Rô","Hai Cơ","hai Bích",
			"Ba Chuồng","Ba Rô","Ba Cơ","Ba Bích",
			"Bốn Chuồng","Bốn Rô","Bốn Cơ","Bốn Bích",
			"Năm Chuồng","Năm Rô","Năm Cơ","Năm Bích",
			"Sáu Chuồng","Sáu Rô","Sáu Cơ","Sáu Bích",
			"Bảy Chuồng","Bảy Rô","Bảy Cơ","Bảy Bích",
			"Tám Chuồng","Tám Rô","Tám Cơ","Tám Bích",
			"Chín Chuồng","Chín Rô","Chín Cơ","Chín Bích",
			"Mười Chuồng","Mười Rô","Mười Cơ","Mười Bích",
			"Bồi Chuồng","Bồi Rô","Bồi Cơ","Bồi Bích",
			"Đầm Chuồng","Đầm Rô","Đầm Cơ","Đầm Bích",
			"Già Chuồng","Già Rô","Già Cơ","Già Bích"
			};
			int[] hinh_anh = 
			{
			R.drawable.c1,R.drawable.d1,R.drawable.h1,R.drawable.s1,
			R.drawable.c2,R.drawable.d2,R.drawable.h2,R.drawable.s2,
			R.drawable.c3,R.drawable.d3,R.drawable.h3,R.drawable.s3,
			R.drawable.c4,R.drawable.d4,R.drawable.h4,R.drawable.s4,
			R.drawable.c5,R.drawable.d5,R.drawable.h5,R.drawable.s5,
			R.drawable.c6,R.drawable.d6,R.drawable.h6,R.drawable.s6,
			R.drawable.c7,R.drawable.d7,R.drawable.h7,R.drawable.s7,
			R.drawable.c8,R.drawable.d8,R.drawable.h8,R.drawable.s8,
			R.drawable.c9,R.drawable.d9,R.drawable.h9,R.drawable.s9,
			R.drawable.c10,R.drawable.d10,R.drawable.h10,R.drawable.s10,
			R.drawable.cj,R.drawable.dj,R.drawable.hj,R.drawable.sj,
			R.drawable.cq,R.drawable.dq,R.drawable.hq,R.drawable.sq,
			R.drawable.ck,R.drawable.dk,R.drawable.hk,R.drawable.sk
			};
	public void ThucHien(View view)
	{
		Random random = new Random();
		int x = random.nextInt(52);
		
		imvHinhAnh.setImageResource(hinh_anh[x]);
		tvTenConVat.setText("Bạn rút được lá "+ten_hinh_anh[x]);
	}

}
